// import axios from "axios"

// axios.defaults.baseURL = "http://localhost:5000"
import axios from "../utlis/utlis"

//登录
export let loginapi = (params) => axios.post("/users/checkLogin", params)

//添加用户
export let adduser = (params) => axios.post("/users/add", params)

//获取账号列表
export let accountList = (params) => axios.get("/users/list", { params })

//删除账号
export let delAccoun = (params) => axios.get("/users/del", { params })

//批量删除账号
export let batchDelAccoun=(params)=>axios.get("/users/batchdel",{ params })

//编辑账号
export let editAccoun = (params) => axios.post("/users/edit", params)

//检测旧密码
export let testingOriginalPwd = (params) => axios.get("/users/checkoldpwd", { params })

//修改密码
export let changePwd = (params) => axios.post("/users/editpwd",  params )

//个人中心
export let personalCenter = (params) => axios.get("/users/accountinfo", { params })

//添加商品分类
export let addSort = (params) => axios.post("/goods/addcate",  params )

//获取商品分类
export let obtainSort = (params) => axios.get("/goods/catelist",  { params } )

//删除商品分类
export let delSort = (params) => axios.get("/goods/delcate", { params })

//修改商品分类
export let modifySort = (params) => axios.post("/goods/editcate", params)

//验证token是否过期
export let verificationToken = (params) => axios.get("/users/checktoken", { params }  )

//删除商品
export let goodsDel = (params) => axios.get("/goods/del", { params })

//修改商品列表
export let goodsEdit = (params) => axios.post("/goods/edit", params)

//查询所有商品分类
export let categories = () => axios.get("/goods/categories",)

//添加商品
export let addGoods = (params) => axios.post("/goods/add", params)

//获取商品列表
export let goodsList=(params)=>axios.get("/goods/list", { params } )


//获取订单列表
export let orderList = (params) => axios.get("/order/list", { params })

//获取订单详情
export let orderDetail = (params) => axios.get("/order/detail", { params })

//修改订单
export let orderEdit = (params) => axios.post("/order/edit",  params )

//获取店铺详情
export let shopInfo = () => axios.get("/shop/info" )

//店铺内容修改
export let shopedit = (params) => axios.post("/shop/edit",params )

//首页报表
export let ordertotaldata = () => axios.get("/order/totaldata")

//订单报表
export let orderordertotal = (params) => axios.get("/order/ordertotal",{params} )


